define(['vue','babel!'+ELMP.resource('download.js','lib')],
  function (Vue,download) {
    console.log(download)
    function render() {
      new Vue({
        el: '#tmzk_test',
        data() {
          return {
            form: {
              // person: null,
              person: {
                id: '00282266dc49cb295b92f9bbd6fd7d36',
                code: '0018',
                displayName: '周俊良'
              }
            },
            rules: {
              person: [
                {
                  required: true,
                  tigger: 'change',
                  validator: (rule, value, callback) => {
                    if (!value||value.length===0) {
                      callback(new Error('请选择人员'))
                      return
                    }
                    callback()
                  }
                }
              ]
            }
          }
        },
        methods: {
          async submit() {
            console.log(this.form)
            await this.$refs.form.validate()
          },
          changePerson(person) {
            console.log(person)
          },
          // 选人组件处理函数
          process(res) {
            console.log(res)
            return res.res.data.records
          }
        }
      })
    }
    return {
      init: render
    }
  })